<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script src="./2.js"></script>
  <h1></h1>
  <script>
    const btn = document.querySelector('button')
    const h1 = document.querySelector('h1')
    Promise.all([
      heihei({ method: 'GET', url: 'http://ajax-base-api-t.itheima.net/api/getbooks' ,data:{id:1},}),
      heihei({ method: 'GET', url: 'http://ajax-base-api-t.itheima.net/api/getbooks' ,data:{id:2},}),
      heihei({ method: 'GET', url: 'http://ajax-base-api-t.itheima.net/api/getbooks' ,data:{id:3},}),
    ])
      .then(res =>{
        h1.innerHTML = `获取成功`  
        console.log(res);
      }
      )
      .catch(err => {
        h1.innerHTML = `404`
        console.log(err);
      })
  </script>
</body>

</html>